<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/WEB-INF/tld/jmesa.tld" prefix="jmesa" %> 
<%@ taglib prefix="c" uri="/WEB-INF/tld/c.tld" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'fileList.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript" src="/estate/js/jquery-1.2.2.pack.js"></script>
    <script type="text/javascript" src="/estate/js/jquery-1.3.min.js"></script> 
    <script type="text/javascript" src="/estate/js/jquery.jmesa.js"></script>
    <script type="text/javascript" src="/estate/js/jmesa.js"></script>     
    <script type="text/javascript" src="/estate/js/ymPrompt.js"></script>

	<link rel="stylesheet" id='skin' type="text/css" href="/estate/images/skin/bluebar/ymPrompt.css" />
    
    <link rel="stylesheet" type="text/css" href="/estate/css/jmesa.css"></link>
    <link rel="stylesheet" type="text/css" href="/estate/css/css.css"></link>
    <script type="text/javascript">
    function showUrl(url)
	{
		window.location.href=url;
	}
	function deleteConfirm(id){
		question=confirm("是否确定要删除此文件？");
		if(question!=0){
			window.location.href="contractFileAction.action?method=delete&deleteId="+id;
		}
	}
    </script>
  </head>
  
  <body>
  
     <div class="main" align="center" style="width:100%;height:400px;">
  <form id="fileForm" action=""  method="post" name="fileForm" >

  
      <jmesa:struts2TableModel items="${fileList}" id="fileTable" var="bean" stateAttr="restore" editable="true" exportTypes="excel"  toolbar="com.estate.utils.JmesaToolBarPage">
          <jmesa:htmlTable style="text-align:center;" width="100%" caption="<div style='height:20px;text-align:center;'>文件列表</div>">
              <jmesa:htmlRow uniqueProperty="id">
                  <jmesa:htmlColumn title="序号" property="id" editable="false"/>
                  <jmesa:htmlColumn title="文件名" property="fileRealName" editable="false" sortable="true"/>
                  <jmesa:htmlColumn title="上传人" property="uploadUser.name" editable="false" sortable="true"/>
                  <jmesa:htmlColumn title="上传日期" property="uploadDate" editable="false"/>
                  <jmesa:htmlColumn title="收到日期" property="receiveDate" editable="false"/>
                   <jmesa:htmlColumn title="文件公司" property="fileCompany" editable="false" sortable="true"/>
                   <jmesa:htmlColumn title="备注" property="remark" editable="false"/>
                   <jmesa:htmlColumn style="align=center" title="操作" editable="false">
                   <a onclick="deleteConfirm(${bean.id})" style="cursor: pointer">删除</a>
                   <a href="contractFileAction.action?method=download&filePath=${bean.filePath}&fileRealName=${bean.fileRealName}" style="cursor: pointer">下载</a>
                   </jmesa:htmlColumn>
                   
              </jmesa:htmlRow>
          </jmesa:htmlTable>
      </jmesa:struts2TableModel>
          <script type="text/javascript">
      function onInvokeAction(id){
          $.jmesa.setExportToLimit(id,'');
          $.jmesa.createHiddenInputFieldsForLimitAndSubmit(id);
      }  
      function onInvokeExportAction(id) {
			var parameterString = $.jmesa.createParameterStringForLimit(id);
			location.href = "testAction.action?method=export&" + parameterString;
      }

  </script>
  </form></div>
  </body>
</html>
